home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
program
/
funnel.zoo
/
sources
/
machin.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-11
|
15KB
|
301 lines
/*##############################################################################
FUNNNELWEB COPYRIGHT
====================
FunnelWeb is a literate-programming macro preprocessor.
Copyright (C) 1992 Ross N. Williams.
Ross N. Williams
ross@spam.adelaide.edu.au
16 Lerwick Avenue, Hazelwood Park 5066, Australia.
This program is free software; you can redistribute it and/or modify
it under the terms of Version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See Version 2 of the GNU General Public License for more details.
You should have received a copy of Version 2 of the GNU General Public
License along with this program. If not, you can FTP the license from
prep.ai.mit.edu/pub/gnu/COPYING-2 or write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Section 2a of the license requires that all changes to this file be
recorded prominently in this file. Please record all changes here.
Programmers:
RNW Ross N. Williams ross@spam.adelaide.edu.au
Changes:
07-May-1992 RNW Program prepared for release under GNU GPL V2.
##############################################################################*/
/******************************************************************************/
/* MACHIN.H */
/******************************************************************************/
/* */
/* WARNING: DO NOT ADD ANY PROGRAM DEPENDENT DEFINITIONS. */
/* */
/* This module (machin.h and machin.c) contains definitions and objects */
/* whose values depends directly on the compilation and execution */
/* environment, but are otherwise independent from any particular computer */
/* program. */
/* */
/* The only difference between the purpose of this module and the "environ" */
/* module is that the "environ" module contains the "essentials" whereas this */
/* module contains extra machine specific definitions and objects that will */
/* not be required by most user modules. */
/* */
/******************************************************************************/
/* Ensure that the body of this header file is included at most once. */
#ifndef DONE_FWMACHIN
#define DONE_FWMACHIN
/******************************************************************************/
#include <time.h>
#include "style.h"
/******************************************************************************/
/* Machine Alignment Constraints */
/* ----------------------------- */
/* Some machines require that objects of particular lengths be aligned in */
/* memory. For example, the 68000 will trap any attempt to access a word */
/* (16 bits or an int in THINK C) at an odd address. It is important that C */
/* programs that deal with memory at a low level be aware of such */
/* constraints. As the constraints are always at a power of two, we defined */
/* ALIGN_POWER to be the minimum power of two at which it is both safe and */
/* efficient to operate. */
/* The Macintosh requires words and longs to be aligned on word boundaries. */
/* The PC is not fussy about alignment, but operates more efficiently at word */
/* boundaries. */
#if MAC | PC
#define ALIGN_POWER (1L)
#endif
/* The Sun requires objects to be aligned on longword boundaries (=2^2). */
/* The VMS VAX doesn't care about alignment, but operates more efficiently on */
/* longword boundaries. */
#if SUN | VMS
#define ALIGN_POWER (2L)
#endif
/******************************************************************************/
/* Filenames */
/* --------- */
/* The length and structure of filenames varies from machine to machine. The */
/* differences addressed here are: */
/* 1) The character used to separate directory specs from filenames. */
/* 2) The maximum length of a filename. */
/* FN_DELIM must contain the character that separates directory specs from */
/* filenames. Notice that in the VMS case, it is "]", not "." */
#if MAC
#define FN_DELIM ':'
#endif
#if SUN
#define FN_DELIM '/'
#endif
#if VAX
#define FN_DELIM ']'
#endif
#if PC
#define FN_DELIM '\\'
#endif
/* The rest of this section shouldn't have to be changed, unless you */
/* encounter a funny with your system's definition of FILENAME_MAX. */
/* FILENAME_MAX tells the maximum number of characters allowed in a filename */
/* on the target machine. This symbol is supposed to be defined in stdio.h */
/* (ANSI S7.9.1) so we don't want to override that. However, if it isn't, we */
/* need to define a safe default length. */
#ifndef FILENAME_MAX
#define FILENAME_MAX 300
#endif
/* Some VAX compilers define FILENAME_MAX to be 39, which is the maximum */
/* length of the NAME part of a VMS filename. This is not appropriate, so we */
/* override it. */
#if VMS
#undef FILENAME_MAX
#define FILENAME_MAX 255 /* Should really be NAM$C_MAXRSS */
#endif
/* Now we can use the constant to define a filename type. */
/* Note: For a while I defined "typedef fn_t *p_fn_t". However, this is a */
/* pointer to an array rather than (char *) and it caused no end of problems. */
typedef char fn_t[FILENAME_MAX+1];
typedef char *p_fn_t;
/******************************************************************************/
/* Command Lines */
/* ------------- */
/* The maximum length of command line varies from machine to machine and we */
/* define symbols to reflect this. The reason why we don't just set this to a */
/* high value and forget about it is that FunnelWeb sometimes places */
/* command line variables on the stack, and some machines (e.g. MAC under */
/* THINK-C don't provide much stack space. So we have to minimize this */
/* variable on those machines. */
/* We choose a small maximum command line on the Macintosh so as to avoid */
/* chewing up stack space when command lines have to be pushed. */
#if MAC
#define COMLINE_MAX 300
#endif
/* On the Sun, 1024 is a normal command line and 2048 is safe. */
#if SUN
#define COMLINE_MAX 2048
#endif
/* On the VMS, 1024 is usually adequate. */
#if VMS
#define COMLINE_MAX 1024
#endif
/* On a PC, we assume this is enough. */
#if PC
#define COMLINE_MAX 300
#endif
/* Make sure that the value is not too low. */
/* The value 300 is guaranteed by the command interpreter. */
#if COMLINE_MAX < 300
#error COMLINE_MAX must be at least 300.
#endif
/* Now define a type for command lines. */
/* Note: For a while I defined "typedef cl_t *p_cl_t". However, this is a */
/* pointer to an array